// The name of the array is a constant pointer to the beginning of the array.
#include "FSBlock.h"

FSBlock::FSBlock(int blockNumber, int length) {
  m_blockNumber = blockNumber;
  // This is a pointer to an array of 512 bytes of data.
  // The array is not initialized.
  // We should initalize it. It is always good to initalize arrays
  // and similar data structures.
  m_buffer = new unsigned char[length];

  // Initalize every possible part of data. Usually zero.
  // You don't want random data coming out of your program
  // that you weren't expecting.
  for (int i=0; i < length; i++) {
    char[i] = '\0';
  }
}

/** ClearBuffer
 * All it does is remove the data values that were there before.
 * Basicly, just reinitalizes data to \0. Could just call ClearBuffer
 * from the constructor.
 */

FSBlock::ClearBuffer() {
}

/** ~FSBlock
 * Destructor
 * A Destructor is only used if the instance was made using new.
 * When do Destructors get called?
 *  1. On delete. But we didn't call new.
 *  2. At the end of the scope (like
 */
FSBlock::~FSBlock() {
  delete[] m_buffer; // [] because m_buffer was allocated as an array
}
